<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/config/c.tld" prefix="c"%>
<%@ taglib prefix="fn" uri="/WEB-INF/config/fn.tld"%>
<%@ taglib prefix="fmt" uri="/WEB-INF/config/fmt.tld"%>
<!DOCTYPE HTML>
<html>
<head>
	<title>${infoTypeClassA.cnName}</title>
</head>
<body>
	<ul class="breadcrumb">
		<li>
			<a href="index.html">首页</a> <i class="icon-angle-right"></i>
		</li>
		<li>
			<a href="info/manage/list/${infoTypeClassA.id }.html">信息管理</a>
			<i class="icon-angle-right"></i></li>
		<li>
			<a href="info/manage/initAdd/${infoTypeClassA.id }.html">${infoTypeClassA.cnName}</a> 
			<i class="icon-angle-right"></i>
		</li>
		<li><a href="#">更新信息</a></li>
	</ul>
	<div class="row-fluid ui-sortable">
		<div class="box span12">
			<div class="box-header" data-original-title>
				<h2>
					<i class="halflings-icon white edit"></i><span class="break"></span>请完善以下信息
				</h2>
				<div class="box-icon">
					<a href="#" class="btn-minimize"><i class="halflings-icon white chevron-up"></i> </a>
				</div>
			</div>
			<div class="box-content">
				<form class="form-horizontal" action="fileupload/manage/save.html" method="post" enctype="multipart/form-data">
					<fieldset>

						<div class="control-group">
							<label class="control-label" for="name">文件名称 </label>
							<div class="controls">
								<input type="text" class="span10" name="name" id="name"  required>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="fileInput">文件</label>
							<div class="controls">
								<input class="input-file uniform_on" id="fileInput" name="fileInput" type="file">选择上传文件

							</div>
						</div>





						<div class="form-actions">
							<button type="submit" class="btn btn-primary">保存信息</button>
							<button type="reset" class="btn">返回</button>
							<input type="hidden" name="infoTypeClassAId" value="${infoTypeClassA.id }"/>
							<input type="hidden" name="id" value="${info.id }"/>
						</div>
					</fieldset>
				</form>
			</div>
		</div>
		<!--/span-->
	</div>
	<script type="text/javascript" src="ueditor/ueditor.config.js"></script>
 	<script type="text/javascript" src="ueditor/ueditor.all.js"></script>
	<!--/row-->
	<script>
		var cnContent = UE.getEditor('cnContent',{
		     initialFrameWidth :740,//设置编辑器宽度
		     initialFrameHeight:350,//设置编辑器高度
		     scaleEnabled:true
	  	});
	  	var enContent = UE.getEditor('enContent',{
		     initialFrameWidth :740,//设置编辑器宽度
		     initialFrameHeight:350,//设置编辑器高度
		     scaleEnabled:true
	  	});
	  	var rtwContent = UE.getEditor('rtwContent',{
		     initialFrameWidth :740,//设置编辑器宽度
		     initialFrameHeight:350,//设置编辑器高度
		     scaleEnabled:true
	  	});
		  
		$("#fileInput").change(function () {
			var objUrl = getObjectURL(this.files[0]);
			console.log("objUrl = " + objUrl);
			if (objUrl) {
				$("#image").attr("src", objUrl);
			}
		});
		//建立一个可存取到该file的url
		function getObjectURL(file) {
			var url = null;
			if (window.createObjectURL != undefined) { // basic
				url = window.createObjectURL(file);
			} else if (window.URL != undefined) { // mozilla(firefox)
				url = window.URL.createObjectURL(file);
			} else if (window.webkitURL != undefined) { // webkit or chrome
				url = window.webkitURL.createObjectURL(file);
			}
	
			return url;
		}
	</script>
</body>
</html>
